setUserAttribute

fun setUserAttribute(context: Context, attributes: Map<String, Any>, appId: String? = null, attributeLevel: UserAttributeLevel = UserAttributeLevel.PROJECT)

Set the user attributes with the attributes specified in the HashMap

Since

12.0.00

Parameters

context

instance of Context

attributes

The attribute map which needs to be set for the user

attributeLevel

level at which the attribute has to be set

Throws

if the attribute level is UserAttributeLevel.PORTFOLIO but the project id is not configured during initialisation


fun setUserAttribute(context: Context, attributeName: String, attributeValue: Any, appId: String? = null, attributeLevel: UserAttributeLevel = UserAttributeLevel.PROJECT)

Track a user attribute in the default instance.

Note: This API only accepts the below data-types:

String, Int, Long, Double, Float, Boolean, Date, GeoLocation, Location , IntArray, ShortArray, LongArray, DoubleArray, FloatArray, Array of String, Array of Int , Array of Double, Array of Long , Array of Short , Array of Float, JSONArray and JSONObject

Since

12.0.00

Parameters

context

instance of Context

attributeName

Attribute Name

attributeValue

Attribute Value

appId

Account identifier, APP ID on the MoEngage Dashboard. If null, default instance will be used

attributeLevel

level at which the attribute has to be set

Throws

if the attribute level is UserAttributeLevel.PORTFOLIO but the project id is not configured during initialisation